// view/zhuce/zhuce.js
let app = getApp()
let yuming = app.globalData.yuming
const request = require('../../config/request');
Page({
  ...request,
  /**
   * 页面的初始数据
   */
  data: {
    buttonClicked: false,
    s2: false,
    yuming: yuming,
    heights: "",
    title: '注册信息',
    hanglist: [{
      ame: '餐饮业态'
    }, {
      name: '企业'
    }], //行业类别
    ytList: [],
    otherhyList: [],
    hangindex: 0, //行业index
    ytindex: 0, //业态分类index
    otherhyindex: 0, //其他行业index
    jielist: [{
      name: '乡企城'
    }, {
      name: '稻香街'
    }], //所属街道
    jieindex: 0, //所属街道index
    shengguo: '请选择省',
    shiguo: '请选择市',
    quguo: '请选择区',
    shenglist: [],
    shilist: [],
    qulist: [],
    shengindex: 0,
    shiindex: 0,
    quindex: 0,
    jiangslist: [], //所属监管所
    jiangsindex: 0,
    myjgylist: [{
      name: '利利'
    }, {
      name: '张伟'
    }], //我的监管员
    myjgyindex: 0,
    hangyeguo: '请选择行业类别', //行业类别
    yetaiguo: '请选择业态分类', //业态分类
    otherhyguo: '请选择其他行业',
    jiangsguo: '请选择所属监管所', //所属监管所
    jieguo: '请选择所属市场/街道', //所属市场
    myjgyguo: '请选择我的监管员', //我的监管员
    zhengs: [{
        tit: '营业执照',
        state: 0,
        img: 'https://msion.xazbwl.com/static/applet/images/index/pho.png',
        tishi: '上传最新的营业执照正本或副本'
      },
      {
        tit: '身份证',
        state: 1,
        img: 'https://msion.xazbwl.com/static/applet/images/index/pho.png',
        tishi: '上传身份证照片'
      },
      {
        tit: '店头照',
        img: '',
        tishi: '上传店头照'
      },
      {
        tit: '免冠照',
        img: '',
        tishi: '上传免冠照'
      },
    ],
    zzxx: '', //店铺营业执照
    photo: [], //其他证照
    dtz: [], //店头照
    mgz: [], //免冠照
    dianname: '', //店铺名字
    fapename: '', //法人姓名
    xinyong: '', //信用代码
    xiangadress: '', //详细地址
    yyzz: '', //营业执照
    // sfz: '', //身份证
    diantz: '', //店头照
    miangz: '', //免冠照
    pid: '', //省id
    cid: '', //市id
    quid: '', //区id
    mobile: '', //手机号
    shopType: '', //0个体  1企业
    hangyeid: '', //行业类别id
    yetaiid: '', //业态分类id
    otherhyid: 0, //其他行业id
    jgsid: '', //监管所id
    scjdid: '', //市场街道id
    jgyid: '', //监管员id
    wudiantz: '', //不带域名店头照
    wuyyzz: '', //不带域名营业执照
    // wusfz: '', //不带域名身份证
    wumiangz: '', //不带域名免冠照
    dianplogo: '', //店头照
    wudianplogo: '', //店头照
    fdaaa: '',
    fdimg: '',

    otherhyxm: '', //其他行业name暂存数据
    otherhyno: '', //其他行业id暂存数据
    showModalStatus: false
  },
  showModal(e) {
    var aaa = e.currentTarget.dataset.aaa
    var img = e.currentTarget.dataset.img
    this.setData({
      fdaaa: aaa,
      fdimg: img
    })
    let {
      type
    } = e.currentTarget.dataset, va = '';
    if (type == 's2') {
      va = "s2";
    }
    this.setData({
      [va]: true
    })
  },
  confirmbtn(e) {
    console.log(e)
    console.log('点击了从新上传！')
    var aaa = this.data.fdaaa
    var that = this;
    this.myChooseImage(1).then(res => {
      const tempFilePaths = res.tempFilePaths
      this.myUploadImg(tempFilePaths[0], 'file').then(res => {
        var data = JSON.parse(res.data)
        wx.showToast({
          title: data.msg,
          icon: 'none'
        })
        var urls = data.httpUrl + data.imgUrl
        //营业执照
        if (aaa == 5) {
          that.yjsbyyz(data.imgUrl);
          that.setData({
            yyzz: urls,
            wuyyzz: data.imgUrl
          })
        }
        // 身份证
        // if (aaa == 6) {
        //   that.setData({
        //     sfz: urls,
        //     wusfz: data.imgUrl
        //   })
        // }
        // 店头照
        if (aaa == 7) {
          that.setData({
            diantz: urls,
            wudiantz: data.imgUrl
          })
        }
        // 免冠照
        if (aaa == 8) {
          that.setData({
            miangz: urls,
            wumiangz: data.imgUrl
          })
        }
        // 店铺logo
        if (aaa == 9) {
          that.setData({
            dianplogo: urls,
            wudianplogo: data.imgUrl
          })
        }
      })
    })

  },
  cancelBtn() {
    console.log('点击了放大！')
    wx.previewImage({
      urls: [this.data.fdimg]
    })
  },
  getIptValue(e) {
    console.log(e.detail)
  },
  // 保存验证
  baocun() {
    if (this.data.dianname == '') {
      wx.showToast({
        title: '店铺/企业名称不能为空',
        icon: 'none'
      })
    } else if (this.data.fapename == '') {
      wx.showToast({
        title: '法人/负责人不能为空',
        icon: 'none'
      })
    } else if (this.data.xinyong == '') {
      wx.showToast({
        title: '社会信用代码不能为空',
        icon: 'none'
      })
    } else if (this.data.shopType == 0 && this.data.hangyeid == '') {
      wx.showToast({
        title: '请选择行业类别',
        icon: 'none'
      })
    } else if (this.data.shopType == 0 && this.data.hangyeid == 13 && this.data.yetaiid == '') {
      wx.showToast({
        title: '请选择业态分类',
        icon: 'none'
      })
    } else if (this.data.checkValue == '') {
      wx.showToast({
        title: '请选择其他行业',
        icon: 'none'
      })
    } else if (this.data.shengguo == '请选择省') {
      wx.showToast({
        title: '请选择省',
        icon: 'none'
      })
    } else if (this.data.shiguo == '请选择市') {
      wx.showToast({
        title: '请选择市',
        icon: 'none'
      })
    } else if (this.data.quguo == '请选择区') {
      wx.showToast({
        title: '请选择区',
        icon: 'none'
      })
    } else if (this.data.xiangadress == '') {
      wx.showToast({
        title: '详细地址不能为空',
        icon: 'none'
      })
    } else if (this.data.jiangsguo == '请选择所属监管所') {
      wx.showToast({
        title: '请选择所属监管所',
        icon: 'none'
      })
    } else if (this.data.jieguo == '请选择所属市场') {
      wx.showToast({
        title: '请选择所属市场',
        icon: 'none'
      })
    } else if (this.data.myjgyguo == '请选择我的监管员') {
      wx.showToast({
        title: '请选择我的监管员',
        icon: 'none'
      })
    } else if (this.data.wuyyzz == '') {
      wx.showToast({
        title: '请上传营业执照',
        icon: 'none'
      })
    }
    //  else if (this.data.wusfz == '') {
    //   wx.showToast({
    //     title: '请上传身份证',
    //     icon: 'none'
    //   })
    // }
    else if (this.data.wudiantz == '') {
      wx.showToast({
        title: '请上传店头照',
        icon: 'none'
      })
    } else if (this.data.wumiangz == '') {
      wx.showToast({
        title: '请上传免冠照',
        icon: 'none'
      })
    } else {
      this.que()
    }
  },
  // 点击确定接口
  que() {
    let that = this
    that.setData({
      buttonClicked: true
    })
    let hyid = 0;
    if (that.data.hangyeid == 13) {
      hyid = that.data.yetaiid
    } else {
      hyid = that.data.hangyeid
    }
    console.log(this.data.checkValue)
    return
    this.myRequest(yuming + 'shop/shopAddInfo', {
      shopType: that.data.shopType,
      mobile: that.data.mobile,
      shopName: that.data.dianname,
      legalPerson: that.data.fapename,
      socialCode: that.data.xinyong,
      stryId: hyid,
      pid: that.data.pid,
      cid: that.data.cid,
      did: that.data.quid,
      shopAddress: that.data.xiangadress,
      regulatorOffice: that.data.jgsid,
      regulatorStreet: that.data.scjdid,
      shopSupervisor: that.data.jgyid,
      businessLicense: that.data.wuyyzz,
      // idcartLicenses: that.data.wusfz,
      shopHeadPhoto: that.data.wudiantz,
      bareheadedPhoto: that.data.wumiangz,
      hangye_label: that.data.checkValue,
      shopLogo: that.data.wudiantz
    }, 'POST').then(res => {
      wx.showToast({
        title: res.data.msg,
        icon: 'none'
      })
      if (res.data.code == 202) {
        wx.showToast({
          title: res.data.msg,
          icon: 'none'
        })
        setTimeout(function () {
          wx.reLaunch({
            url: '/page_zhu/shou/shou',
          })
        }, 1000)
      }
      if (res.data.code == 200) {
        console.log(111)
        // wx.setStorageSync('shopType', res.data.shopType)
        wx.setStorageSync('shopId', res.data.shopId)
        setTimeout(function () {
          wx.reLaunch({
            url: '/pages/index/index',
          })
        }, 1000)
      }
      if (res.data.code == 201) {
        setTimeout(function () {
          wx.reLaunch({
            url: '/page_zhu/shou/shou',
          })
        })
      }
    })
  },
  // 上传
  chuan(e) {
    var aaa = e.currentTarget.dataset.aaa //店头营业执照
    var that = this;
    this.myChooseImage(1).then(res => {
      const tempFilePaths = res.tempFilePaths
      this.myUploadImg(tempFilePaths[0], 'file').then(res => {
        var data = JSON.parse(res.data)
        wx.showToast({
          title: data.msg,
          icon: 'none'
        })
        var urls = data.httpUrl + data.imgUrl
        //营业执照
        if (aaa == 5) {
          that.yjsbyyz(data.imgUrl);
          that.setData({
            yyzz: urls,
            wuyyzz: data.imgUrl
          })
        }
        // 身份证
        // if (aaa == 6) {
        //   that.setData({
        //     sfz: urls,
        //     wusfz: data.imgUrl
        //   })
        // }
        // 店头照
        if (aaa == 7) {
          that.setData({
            diantz: urls,
            wudiantz: data.imgUrl
          })
        }
        // 免冠照
        if (aaa == 8) {
          that.setData({
            miangz: urls,
            wumiangz: data.imgUrl
          })
        }
        // 店铺logo
        if (aaa == 9) {
          that.setData({
            dianplogo: urls,
            wudianplogo: data.imgUrl
          })
        }
      })
    })
  },
  // 上传图片
  // sctp(file) {
  //   wx.uploadFile({
  //     url: yuming + 'Besall/Upload',
  //     filePath: file,
  //     name: "image",
  //     header: {
  //       'Content-Type': 'application/x-www-form-urlencoded',
  //       'Token': wx.getStorageSync('token'),
  //     },
  //     formData: {
  //       file: file
  //     },
  //     success(res) {
  //       console.log(res)
  //       wx.showToast({
  //         title: res.data.msg,
  //         icon: 'none'
  //       })
  //     }
  //   })
  // },
  // 店铺名称
  dianname(e) {
    this.setData({
      dianname: e.detail.value
    })
  },
  // 法人
  fapename(e) {
    this.setData({
      fapename: e.detail.value
    })
  },
  // 信用代码
  xinyong(e) {
    this.setData({
      xinyong: e.detail.value
    })
  },
  // 详细地址
  xiangadress(e) {
    this.setData({
      xiangadress: e.detail.value
    })
  },
  // 行业类别
  hangs(e) {
    this.setData({
      hangyeguo: this.data.hanglist[e.detail.value].cartTitle,
      hangyeid: this.data.hanglist[e.detail.value].id,
    });
    console.log(this.data.hangyeid)
    this.getytList();
  },
  yetais(e) {
    this.setData({
      yetaiguo: this.data.ytList[e.detail.value].cartTitle,
      yetaiid: this.data.ytList[e.detail.value].id,
    });
    console.log(this.data.yetaiguo)
    console.log(this.data.yetaiid)
    wx.setStorageSync('ytName', this.data.yetaiguo)
    this.getytList();
  },
  // 其他行业类别
  otherhy(e) {
    this.setData({
      otherhyguo: this.data.otherhyList[e.detail.value].name,
      otherhyid: this.data.otherhyList[e.detail.value].id,
    });
  },
  getytList() {
    let that = this
    this.myRequest(yuming + 'Besall/cartrelationList', {
      typeMold: 2,
      fid: that.data.hangyeid
    }, 'POST').then(res => {
      that.setData({
        ytList: res.data.data,
      })
    })
  },
  // 所属市场
  jies(e) {
    var id = this.data.jielist[e.detail.value].id
    this.setData({
      jieguo: this.data.jielist[e.detail.value].mation,
      scjdid: id,
      myjgyguo: '请选择我的监管员',
      jgyid: ''
    });
    this.jgy(id)
  },
  // 所属监管所
  bindjiangs(e) {
    var id = this.data.jiangslist[e.detail.value].id
    this.setData({
      jiangsguo: this.data.jiangslist[e.detail.value].mation,
      jgsid: id,
      jieguo: '请选择所属市场/街道',
      scjdid: '',
      myjgyguo: '请选择我的监管员',
      jgyid: ''
    })
    this.shsc(id)
  },
  // 我的监管员
  bindmyjgy(e) {
    this.setData({
      myjgyguo: this.data.myjgylist[e.detail.value].mation,
      jgyid: this.data.myjgylist[e.detail.value].id
    })
  },
  // 省
  bindsheng(e) {
    var id = this.data.shenglist[e.detail.value].areaId
    this.setData({
      shengguo: this.data.shenglist[e.detail.value].areaName,
      pid: id,
      shiguo: '请选择市',
      cid: '',
      quguo: '请选择区',
      quid: '',
      jiangsguo: '请选择所属监管所',
      jgsid: '',
      jieguo: '请选择所属市场/街道',
      scjdid: '',
      myjgyguo: '请选择我的监管员',
      jgyid: ''
    })
    this.getCity(id)
  },
  // 市
  bindshi(e) {
    var id = this.data.shilist[e.detail.value].areaId
    if (this.data.shengguo == '请选择省') {
      wx.showToast({
        title: '请选择省',
        icon: 'none'
      })
    } else {
      this.setData({
        shiguo: this.data.shilist[e.detail.value].areaName,
        cid: id,
        quguo: '请选择区',
        quid: '',
        jiangsguo: '请选择所属监管所',
        jgsid: '',
        jieguo: '请选择所属市场/街道',
        scjdid: '',
        myjgyguo: '请选择我的监管员',
        jgyid: ''
      })
      this.getArea(id)
    }
  },
  // 区
  bindqu(e) {
    if (this.data.shiguo == '请选择市') {
      wx.showToast({
        title: '请选择市',
        icon: 'none'
      })
    } else {
      this.setData({
        quguo: this.data.qulist[e.detail.value].areaName,
        quid: this.data.qulist[e.detail.value].areaId,
        jiangsguo: '请选择所属监管所',
        jgsid: '',
        jieguo: '请选择所属市场/街道',
        scjdid: '',
        myjgyguo: '请选择我的监管员',
        jgyid: ''
      })
      this.jgs(0)
    }
  },
  //营业执照一键识别
  yjsbyyz(imgurl) {
    wx.showLoading({
      title: '识别营业执照中',
      icon: 'none'
    })
    let that = this
    this.myRequest(yuming + 'Besall/ai_business_license_v1', {
      imgUrl: imgurl
    }, "POST").then(res => {
      if (res.data.code == 200) {
        wx.showToast({
          title: '识别成功',
          icon: 'none'
        })
        wx.hideLoading();
        let data = res.data.data.营业执照识别实体信息
        that.setData({
          dianname: data.企业名称,
          fapename: data.企业法人,
          xinyong: data.企业统一社会信用编码,
          shengguo: data.企业所在省份,
          shiguo: data.企业所在城市,
          quguo: data.企业所在区域,
          xiangadress: data.企业注册地址,
        })
        if (data.企业所在省份 != '' && data.企业所在城市 != '' && data.企业所在区域 != '') {
          let pid = that.data.shenglist.filter(item => item.areaName == that.data.shengguo)[0].areaId;
          that.setData({
            pid: pid
          })
          that.doCity(pid);
        } else {
          let shengguo = ''
          let shiguo = ''
          let quguo = ''
          if (data.企业所在省份 == '') {
            shengguo = '请选择省'
          }
          if (data.企业所在城市 == '') {
            shiguo = '请选择市'
          }
          if (data.企业所在区域 == '') {
            quguo = '请选择区'
          }
          this.setData({
            shengguo,
            shiguo,
            quguo
          })
        }
      }
    })
  },
  async doCity(pid) {
    await this.getCity(pid);
    console.log(this.data.shilist);
    let cid = this.data.shilist.filter(item => item.areaName == this.data.shiguo)[0].areaId;
    this.setData({
      cid: cid
    })
    this.doArea(cid);
  },
  async doArea(cid) {
    await this.getArea(cid);
    console.log(this.data.qulist);
    let quid = this.data.qulist.filter(item => item.areaName == this.data.quguo)[0].areaId;
    this.setData({
      quid: quid
    })
    this.jgs(0);
  },
  // 返回
  backs() {
    wx.navigateBack({
      delta: 0
    })
  },
  // 行业类别查询
  hylb() {
    var that = this
    var typeMold = ''
    var shopType = this.data.shopType
    if (shopType == 0) { //0个体 1企业
      typeMold = 2 //1企业 2个体户
    }
    if (shopType == 1) {
      typeMold = 1
    }
    this.myRequest(yuming + 'Besall/cartrelationList', {
      typeMold: typeMold
    }, 'POST').then(res => {
      if (res.data.code == 200) {
        // let otherhyList = res.data.hangyeLabel;
        // otherhyList.forEach(item => {
        //   item.checked = false;
        // })
        this.setData({
          hanglist: res.data.data,
          otherhyList:res.data.hangyeLabel
        })
        console.log(this.data.otherhyList)
        if (this.data.hangyeid) {
          this.setData({
            hangyeguo: this.data.hanglist.find(item => item.id == this.data.hangyeid).cartTitle
          })
          this.getytList();
        }
      }
    })
  },
  // 获取省列表
  getProvince: function () {
    let that = this
    this.myRequest(yuming + 'Besall/areaList', {
      parentId: 0,
      areaType: 0,
    }, 'POST').then(res => {
      that.setData({
        shenglist: res.data.data, //省级原始数据
      })
      let defaultCode = that.data.shenglist[0].areaId //使用第一项当作参数获取市级数据
      if (defaultCode) {
        that.getCity(defaultCode) //获取市区数据
      }
    })
  },
  //获取市列表
  getCity: function (id) {
    return new Promise((resolve, reject) => {
      let that = this
      this.myRequest(yuming + 'Besall/areaList', {
        parentId: id,
        areaType: 1,
      }, 'POST').then(res => {
        that.setData({
          shilist: res.data.data, //保持市级数据
        })
        let defaultCode = that.data.shilist[0].areaId //获取第一个市的区级数据
        if (defaultCode) {
          that.getArea(defaultCode) //获取区域数据
        }
        resolve(res);
      }).catch(err => {
        reject(err);
      })
    })
  },
  //获取区列表
  getArea: function (id) {
    return new Promise((resolve, reject) => {
      let that = this
      this.myRequest(yuming + 'Besall/areaList', {
        parentId: id,
        areaType: 2,
      }, 'POST').then(res => {
        that.setData({
          qulist: res.data.data, //区列表
          quid: res.data.data[0].areaId
        })
        resolve(res)
      }).catch(err => {
        reject(err)
      })
    })
  },
  // 点击区获取所属监管所
  jgs(id) {
    let that = this
    this.myRequest(yuming + 'shop/shopAreaMarketerList', {
      cityId: that.data.quid,
      fid: id
    }, 'POST').then(res => {
      that.setData({
        jiangslist: res.data.data
      })
    })
  },
  // 所属市场
  shsc(id) {
    let that = this
    this.myRequest(yuming + 'shop/shopAreaMarketerList', {
      cityId: that.data.quid,
      fid: id
    }, 'POST').then(res => {
      that.setData({
        jielist: res.data.data
      })
    })
  },
  // 监管员
  jgy(id) {
    let that = this
    this.myRequest(yuming + 'shop/shopAreaMarketerList', {
      cityId: that.data.quid,
      fid: id
    }, 'POST').then(res => {
      that.setData({
        myjgylist: res.data.data
      })
    })
  },



  //点击我显示底部弹出框
  clickme: function () {
    this.showTan();
  },

  //显示对话框
  showTan: function () {
    // 显示遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
      showModalStatus: true
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export()
      })
    }.bind(this), 200)
  },
  //隐藏对话框
  hideModal: function () {
    // 隐藏遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    // if (this.data.otherhyid) {
    //   let otherhyList = this.data.otherhyList;
    //   let otherhyid = this.data.otherhyid.split(',')
    //   otherhyList.forEach(item => {
    //     item.checked = false;
    //     otherhyid.forEach(items => {
    //       if (items == item.id) {
    //         item.checked = true
    //       }
    //     })
    //   })
    //   this.setData({
    //     otherhyxm: this.data.otherhyguo,
    //     otherhyno: this.data.otherhyid,
    //     otherhyList
    //   })
    // } else {
    //   this.data.otherhyList.forEach(item => {
    //     item.checked = false
    //   })
    //   this.setData({
    //     otherhyList: this.data.otherhyList
    //   })
    // }
    this.setData({
      animationData: animation.export(),
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export(),
        showModalStatus: false
      })
    }.bind(this), 200)
  },
  selected() {
    let otherhyguo = '';
    if (this.data.otherhyxm != '') {
      otherhyguo = this.data.otherhyxm
    } else {
      otherhyguo = '请选择其他行业分类'
    }
    this.setData({
      otherhyguo,
      otherhyid: this.data.otherhyno,
      showModalStatus: false
    })
  },
  //多选
  userCheck: function (e) {
    let index = e.currentTarget.dataset.id; //获取用户当前选中的索引值
    let Box = this.data.otherhyList
    if (Box[index].checked) {
      this.data.otherhyList[index].checked = false;
    } else {
      this.data.otherhyList[index].checked = true;
    }
    this.setData({
      otherhyList: this.data.otherhyList
    })
    // 返回用户选中的值
    let value = Box.filter((item, index) => {
      return item.checked == true;
    })
    let xditem = '';
    let xdid = '';
    value.forEach((item, index) => {
      xditem += item.name + ','
      xdid += item.id + ','
    })
    if (xditem.slice(-1) == ',') {
      xditem = xditem.slice(0, xditem.length - 1);
    }
    if (xdid.slice(-1) == ',') {
      xdid = xdid.slice(0, xdid.length - 1);
    }
    this.setData({
      otherhyxm: xditem,
      otherhyno: xdid,
    })
    console.log(this.data.otherhyList)
  },
  checkbox: function (e) {
    var index = e.currentTarget.dataset.index; //获取当前点击的下标
    var otherhyList = this.data.otherhyList; //选项集合
    otherhyList[index].checked = !otherhyList[index].checked; //改变当前选中的checked值
    this.setData({
      otherhyList: otherhyList
    });
  },
  checkboxChange: function (e) {
    var checkValue = e.detail.value;
    this.setData({
      checkValue: checkValue
    });
    console.log(this.data.checkValue)
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options)
    this.setData({
      heights: wx.getMenuButtonBoundingClientRect().top + 5,
      mobile: options.mobile,
      shopType: options.shopType,
      title: options.title
    })
    if (options.hangyeid) {
      wx.setStorageSync('stryId', options.hangyeid)
    }
    this.setData({
      hangyeid: wx.getStorageSync('stryId')
    })

    this.hylb() // 行业类别
    this.getProvince() //获取省
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
})